package com.mooco.dongba.sys.dao;

import com.mooco.dongba.common.pojo.Node;
import com.mooco.dongba.sys.pojo.SysMenu;
import com.mooco.dongba.sys.pojo.SysUserMenu;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface SysMenuDao {
    List<SysUserMenu> findUserMenusByIds(List<Integer> menuIds);

    List<Map<String, Object>> findObjects();

    int getChildCount(Integer id);

    @Delete("delete from sys_menus where id=#{id}")
    int deleteObject(Integer id);

    List<Node> findZTreeMenuNodes();

    int insertObject(SysMenu entity);

    int updateObject(SysMenu entity);

    List<String> findPermissions(@Param("menuIds") List<Integer> menuIds);
}
